/*
//获取圆周率
var i=['1','1312','1212','5454']
console.log(Math.PI);
var n = Math.floor( Math.random()*10);
console.log(n)
console.log(i[n])
*/
//将一句英文中的每个单词的首字母大写,其余字母小写
//      hOw aRe yOU  ->   How Are You
var str = 'hOw aRe yOU';
str1 = str.split(" ");
for (i=0,c="",d="";i<str1.length;i++ ){
	for (j=0;j<str1[i].length ;j++ ){
	var str2=str1[i][0].toUpperCase()
	str3 = str1[i].split("")
}
	var str3=str3.slice(1).join('').toLowerCase() 
		c=str2+str3
		d =d+c+" "
}
console.log(d)
	
	
	
	/*{
	var d = str1[i].slice(0,1).toUpperCase() 
	var  e =str1[i].slice(1).toLowerCase() 
		c +=(d+e+" ")
}			
		console.log(c)
*/
/*
//随机获取a~z之间的四个字母,放入到一个新的数组

var arr = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'];
for (i=0,j="";i<4 ;i++ ){
	var arr2=arr[Math.floor(Math.random()*26)];
		j +=arr2
}
console.log(j.split(''));
*/
for (i=0,j="";i<6;i++ ){
	var str=Math.floor(Math.random()*34)
		if (str===0){
		i -=1
		}else{
		j +=str+" "
		}
}

j.slice(-1)
console.log(j)
/*
for (var e = 0;e <j.length-1;e++){
	//内存循环:控制每一轮比较的次数
	for (var f = 0;f < j.length-e-1 ;f++ ){
		if(arr[f]>arr[f+1]){
		var c = [f];
		arr[f]=arr[f+1];
		arr[f+1]=c;
		console.log(c)
		}
	}
}
//console.log(c)

*/